package com.example.springaopdemo2.Config;import org.springframework.context.annotation.Configuration;import org.springframework.web.servlet.config.annotation.InterceptorRegistry;import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;/** * 该类为配置类，SpringBoot启动加载配置 */@Configurationpublic class AppConfig implements WebMvcConfigurer {    @Override    public void addInterceptors(InterceptorRegistry registry)    {        //添加拦截器        registry.addInterceptor(new LoginInterceptor())                .addPathPatterns("/**")  //拦截的路径，/**表示项目目录下所有                .excludePathPatterns("/user/login") //排除拦截的选项                .excludePathPatterns("/user/reg")                .excludePathPatterns("/login.html")                .excludePathPatterns("/user/getnum");    }}